/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.rcnss.ui.table.handler;

import com.vaadin.event.Action;
import com.vaadin.event.Action.Handler;
import com.vaadin.ui.Table;

/**
 *
 * @author Guesmi
 */
public class GeneralActionHandler implements Handler{

    private Action ACTION_DEL = new Action("Supprimer");

    public Action[] getActions(Object target, Object sender) {
        return new Action[] {ACTION_DEL};
    }

    public void handleAction(Action action, Object sender, Object target) {
        if(action.equals(ACTION_DEL))
        {
            ((Table)sender).removeItem(target);
        }
    }

}
